#coding:utf-8
from . import db
from pymongo.collection import Collection


class User(object):
    COL_NAME = 'UserCol'
    col = Collection(db, COL_NAME)
    class Field(object):
        _id = '_id'
        url = 'url'
        ans_num = 'ans_num'
        ask_num = 'ask_num'
        agree_num = 'agree_num'
        article_num = 'article_num'
        thanks_num = 'thanks_num'
        fav_num = 'fav_num' #收藏数
        share_num = 'share_num'
        followers_num = 'followers_num'
        followees_num = 'followees_num'
        gender = 'gender' #性别
        user_name = 'user_name'
        location = 'location'
        business = 'business' #行业
        employment = 'employment'
        education = 'education'
        education_extra = 'education_extra'
        view_num = 'view'
        description = 'description'
        date = 'date'

    col.ensure_index([('url',1),('date',1)],unique=True) #唯一性索引

class SearchFollowerUser(object):
    COL_NAME = 'SearchFollowerUser'
    col = Collection(db, COL_NAME)
    class Field(object):
        _id = '_id'
        url = 'url'
        count = 'count'

class SearchFolloweeUser(object):
    COL_NAME = 'SearchFolloweeUser'
    col = Collection(db, COL_NAME)
    class Field(object):
        _id = '_id'
        url = 'url'
        count = 'count'
